package com.bytz.modules.system.feign;

import feign.Response;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

@FeignClient(name = "convert-pdf-api", path = "${convert-pdf-api.context-path:}")
public interface IPdfConvertServiceClient {

    /**
     * word转为pdf
     * @param file
     * @return
     * @throws IOException
     */
    @RequestMapping(value="/wordtopdf",method = RequestMethod.POST,consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    Response convertWordToPdf(@RequestPart("file") MultipartFile file) throws IOException;

    /**
     * excel转为pdf
     * @param file
     * @return
     * @throws IOException
     */
    @RequestMapping(value="/sheet2pdf",method = RequestMethod.POST,consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    Response convertSheetToPdf(@RequestPart("file") MultipartFile file) throws IOException;

    /**
     * ppt转为pdf
     * @param file
     * @return
     * @throws IOException
     */
    @RequestMapping(value="/ppt2pdf",method = RequestMethod.POST,consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    Response convertPptToPdf(@RequestPart("file") MultipartFile file) throws IOException;

    /**
     * dwg转为pdf
     * @param file
     * @return
     * @throws IOException
     */
    @RequestMapping(value="/dwg2pdf",method = RequestMethod.POST,consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    Response convertDwgToPdf(@RequestPart("file") MultipartFile file) throws IOException;



}
